<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Welcome</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../layui-admin/layui/css/layui.css" rel="stylesheet">
    <link href="../layui-admin/layui/css/layedit.css" rel="stylesheet">
    <link href="../layui-admin/adminui/css/admin.css" rel="stylesheet">
    <link href="../layui-admin/adminui/css/login.css" rel="stylesheet">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space5">
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">富文本编辑器</div>
                <div class="layui-card-body">
                    <form class="layui-form">
                        <div class="layui-form-item">
                            <textarea id="edit" name="edit" class="layui-hide"></textarea>
                        </div>
                        <div class="layui-form-item">
                            <a class="layui-btn layui-btn-fluid" layadmin-event="submit">提交</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">主题信息</div>
                <div class="layui-card-body layui-text layadmin-version">
                    <table class="layui-table">
                        <colgroup>
                            <col width="100">
                            <col>
                        </colgroup>
                        <tbody>
                        <tr>
                            <td>Version</td>
                            <td>
                                <script type="text/html" template>
                                    v{{ layui.admin.v }}
                                </script>
                            </td>
                        </tr>
                        <tr>
                            <td>Layui</td>
                            <td>
                                <script type="text/html" template>
                                    v{{ layui.v }}
                                </script>
                            </td>
                        </tr>
                        <tr>
                            <td>LayIM</td>
                            <td id="LayIM">
                                v{{ layui.layim.v }}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../layui-admin/layui/layui.js"></script>
<script>
    layui.config({
        base: '../layui-admin/'
    }).config({
        layimPath: layui.cache.base + 'modules/layim/',
        layimResPath: layui.cache.base + 'modules/layim/res/'
    }).use(['index', 'layedit', 'layim'], function () {

        const edit = layui.layedit.build('edit', {
            height: 280
            , uploadImage: {
                url: 'json/upload.json'
            }
            , type: 'get'
        });

        layui.admin.events.submit = function () {
            alert(layui.layedit.getContent(edit));
        };

        layui.$('#LayIM').html(layui.laytpl(layui.$('#LayIM').html()).render({}));
        layui.layim.config({
            init: {
                url: 'json/im-config.json'
            }
            , uploadImage: {
                url: 'json/upload.json'
            }
        });
    });
</script>
</body>
</html>
